﻿<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:DisplayMap">
    <Style TargetType="{x:Type local:Cartouche}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:Cartouche}">
                    <Canvas>
                        <Rectangle x:Name="rect"
                                Fill="{TemplateBinding Background}"
                                Stroke="{TemplateBinding BorderBrush}"
                                StrokeThickness="1"
                                RadiusX="{TemplateBinding Radius}"
                                RadiusY="{TemplateBinding Radius}"
                                Width="{Binding ActualWidth, ElementName=textBlock }"
                                Height="{Binding ActualHeight, ElementName=textBlock }"
                            >
                        </Rectangle>
                        <TextBlock x:Name="textBlock"
                            Background="Transparent"
                            VerticalAlignment="Center"
                            HorizontalAlignment="Center"
                            Text="{TemplateBinding Text}"
                            >
                            
                        </TextBlock>
                    </Canvas>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
